package com.sneakxy.cloudbase.platform.bean;

import java.io.Serializable;

import org.springframework.data.domain.Persistable;

/**
 * @author 潜行的青衣
 * @see
 */
public abstract class BaseEntity<I extends Serializable> implements Persistable<I>, Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6045324674672829429L;

	/* (non-Javadoc)
	 * @see org.springframework.data.domain.Persistable#isNew()
	 */
	@Override
	public boolean isNew() {
		I id = this.getId();
		if(id == null) {
			return true;
		}
		if (id instanceof Number) {
			return ((Number) id).floatValue() == 0f;
		}
		return false;
	}

	public void setNew(boolean isNew) {}
	
}
